<?php
/*
# ------------------------------------------------------------------------
# JA Job Board Package
# ------------------------------------------------------------------------
# Copyright (C) 2004-2010 JoomlArt.com. All Rights Reserved.
# @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
# Author: JoomlArt.com
# Websites: http://www.joomlart.com - http://www.joomlancers.com.
# ------------------------------------------------------------------------
*/
  defined('_JEXEC') or die('Retricted Access');
  global $option;
  $jbconfig = $this->config;
  $customerDetail = $this->customerDetail;
  $item = $this->item;
  $customer = JRequest::getVar('username');
  $user_id = JRequest::getVar('userid');
  $user = JFactory::getUser($item->user_id);
  if (strtolower($item->product_type)=='s')
  	$product_type_name = 'Subscription';
  elseif (strtolower($item->product_type)=='p')
  	$product_type_name = 'Posting Plan';
  else 
  	$product_type_name = 'Credit';
  $item_title = JRequest::getVar('item_title');

?>


<form name="adminForm" action="index.php" method="post" enctype="multipart/form-data">

	<table width="100%">
	<?php 
	$task = JRequest::getVar('task');
	if ($task=='trans_viewbyuser')
	{
	?>
		<tr>
			<td width="80%" valign="top">
				<div style="width:100%;">
					<?php echo $this->menu();?>
				</div>
			</td>
		</tr>
	<?php
	}
	?>	
	<tr>
	
		<td width="80%" valign="top" align="center">
		<fieldset>
		    <div style="width:80%;" align="center">
		    	<br />
		    	<div style="font_weight:bold;border-bottom: 1px solid #D8D8D8;">
					<b>
						<?php echo JText::_('INVOICE')?>
					</b>
			
				</div>
				<br />
				<table align="left" width="100%">
					<tr>
						<td width="50%">
							<b>
								<?php echo JText::_('BILL TO')?>
							</b>
						</td>
						<td width="50%">
							<b>
								<?php echo JText::_('SHIP TO')?>
							</b>
						</td>
					</tr>
					<tr>
						<td width="50%">
							<?php echo $customer; ?>
						</td>
						<td width="50%">
							<?php echo $jbconfig['payment']->get('sys_invoice_username'); ?>
						</td>
					</tr>
					<tr>
						<td width="50%">
							<?php echo JText::_('Company')?>: <?php echo @$customerDetail->company; ?>
						</td>
						<td width="50%">
							<?php echo JText::_('Company')?>: <?php echo $jbconfig['payment']->get('sys_invoice_company'); ?>
						</td>
					</tr>
					<tr>
						<td width="50%">
							<?php echo JText::_('Email')?>: <?php echo $user->email; ?>
						</td>
						<td width="50%">
							<?php echo JText::_('Email')?>: <?php echo $jbconfig['payment']->get('sys_invoice_email'); ?>
						</td>
					</tr>
					<tr>
						<td width="50%">
							<?php echo JText::_('Phone')?>: <?php echo @$customerDetail->tel; ?>
						</td>
						<td width="50%">
							<?php echo JText::_('Phone')?>: <?php echo $jbconfig['payment']->get('sys_invoice_phone'); ?>
						</td>
					</tr>
					<tr>
						<td width="50%">
							<?php echo JText::_('Location')?>: <?php echo @$customerDetail->name; ?>
						</td>
						<td width="50%">
							<?php echo JText::_('Location')?>: <?php echo $jbconfig['payment']->get('sys_invoice_location'); ?>
						</td>
					</tr>
				</table>
				
				<br />
				<hr />
				<table align="left" width="100%">
					<tr>
						<td width="100%">
							<hr />
						</td>
					</tr>
					<tr>
						<td>
							<?php echo JText::_('INVOICE NO')?>: <?php echo $item->id; ?> <br />
							<?php echo JText::_('PRODUCT TYPE')?>: <?php echo JText::_($product_type_name); ?>  <br />
							<?php echo JText::_('PRODUCT NAME')?>: <?php echo $item_title; ?> <br />
							<?php echo JText::_('Date')?>: <?php echo generateDate($item->created_date); ?> <br />
							<?php echo JText::_('Amount')?>: <?php echo $item->amount; ?> (<?php echo $item->currency_code?>) <br />
							<?php if($item->completed==1) $status = JText::_('Paid'); else $status = JText::_('Not Paid');?>
							<?php echo JText::_('Status').": ".$status?>
						</td>
					</tr>
				</table>
			</div>
			</fieldset>
		</td>
	</tr>
	</table>
	<input type="hidden" name="pre_task" value="<?php echo $task; ?>">
	<input type="hidden" name="id" value="<?php echo $item->id; ?>">
	<input type="hidden" name="option" value="<?php echo $option; ?>" />
	<input type="hidden" name="view" value="jatransactions" />
	<input type="hidden" name="task" value="" />
	<input type="hidden" name="userid" value="<?php echo $user_id; ?>" />
</form>